package com.piedra.regex;

import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class FindMethodTest {
	
	public static void main(String[] args){
		new FindMethodTest().start();
	}
	
	private void start(){
		String str = "hello, welcome to java world. I am very happly. Good luck to you.";
		String regex = "\\b[\\w]{4}\\b";
		
		Pattern p = Pattern.compile(regex);
		Matcher m = p.matcher(str);
		while(m.find()){
			System.out.println(m.group());
		}
		
	}
}
